<template>
  <div class="box">
    <h1>Child{{index}}</h1>
    <button @click="addCountParent">累加父组件的数据</button>
    <button @click="$emit('click')">click1专属点击按钮</button>
  </div>
</template>

<script>
export default {
  name: "Child",
  props: ["index"],

  methods: {
    addCountParent(){
      this.$emit("click" , 100)
    }
  },
};
</script>

<style scoped>
.box {
  background: yellowgreen;
}
</style>
